<link href="style.css" rel="stylesheet" type="text/css" />
<link href="css/estilos.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/ecmascript" src="js/form.js"></script>
<script language="javascript" type="text/ecmascript" src="js/prototype.js"></script>
<?php
session_start();
include("conex.php");
import_request_variables("g,P");

//print_r($_GET);

$sql="SELECT id_principal, CONCAT(cNombre,' ',cPaterno,' ',cMaterno) FROM dat_registro WHERE ";


if($tRFC && ($tNombre || $tAPaterno || $tAMaterno) ){  $sql.=" OR";}

if($tNombre || $tAPaterno || $tAMaterno){ 
	$sql.=" CONCAT(cNombre,cPaterno,cMaterno) like '%".$tNombre.$tAPaterno.$tAMaterno."%'";
}

$sql.=" AND id_unidad = ".$_SESSION['idunidad']." ORDER BY id_principal";

?>
<form id='test' name='test' method='post'>
<table width='750' align='center' cellpadding='0' cellspacing='0'  border='1' class='cuadro2 datos'>
  <tr>
    <td bordercolor="#EAEAEA" bgcolor='#FFFFFF' class="datos"><strong>Nombre</strong></td>
    
    
	<td bordercolor="#EAEAEA" bgcolor='#FFFFFF' class="datos">MODIFICAR</td>
  </tr>
  <tr>
    <td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos">
    <?php
	$qry=mysql_query($sql,$link) or die(mysql_error().$sql);
	$total=mysql_num_rows($qry);
	while($web = mysql_fetch_array($qry)){
					echo $web[1];
				?>	
    </td>

	<td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos">
	<div align='center'><a href='modif_paciente.php?idprincipal=<?php echo $web[0]; ?>'><img src='images/libro.jpg' alt='Consultas' name='consulta' width='30' height='30' border='0'></a></div>	</td>
  </tr>
  <tr>
  <td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos">
 <?php } ?>  </td>
  <td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos"></td>
    <td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos">    </td>
  </tr>
   <tr>
  <td bordercolor="#EAEAEA" bgcolor="#FFFFFF" class="datos" colspan="3"> <input type='button' value='NUEVA BUSQUEDA' class='datos' onclick='muestraw()' bordercolor='#FFFFFF'> </td>
  </tr>
</table>
</form>


